<!DOCTYPE html>
<html lang="en" style="height:100%">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>注册</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>
</head>
<body style="height:100%;background: white;">
<div id="blank" class="header">
    <div v-back.tapmode class="back"></div>
    <span class="title">注册</span>
</div>
<div class="login" id="app" v-cloak >
    <div class="login-tip" >
        <p>请验证您的手机信息</p>
    </div>
    <div class="login-body">
        <div class="body-out">
            <div class="bd-line qrcode">
                <img v-src="'../../image/login_phone.png'"/>
                <div class="send-border">
                    <input type="number" placeholder="请输入手机号码" v-model="phone"/>
                </div>
            </div>
            <div class="bd-line qrcode" >
                <img v-src="'../../image/login_qr.png'" style="float: left ;"/>
                <div class="send-border" style="position:relative">
                    <input type="number" placeholder="请输入验证码" v-model="verify_code"/>
                    <sendcode :phone="phone" type="1" style="right:0"></sendcode>
                </div>
            </div>
            <div class="bt-login">
                <a class="btn register-btn" v-myclick="setPass">下一步</a>
            </div>
        </div>
    </div>

</div>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script src="../../script/components.js"></script>
<script>
    var talkingData;
    apiready = function () {
        setBSImg();
        new Vue({
            el:'#blank',
        });
        talkingData = api.require('talkingData');
        initApp();
        api.parseTapmode();
    };

    function initApp() {
        var isBigImg = Vue.BSImg == 'big';
        new Vue({
            el: '#app',
            data:{
                phone:null,
                verify_code:null,
                isTip:false,
                BSImg:{
                    big:isBigImg,
                    small:!isBigImg
                }
            },
            methods:{
                setPass:function(){
                    if(!this.phone){
                        pinet.alert("请输入手机号");
                        return ;
                    }
                    if(!this.verify_code){
                        pinet.alert("请输入验证码");
                        return ;
                    }
                    if(this.phone&&this.verify_code){
                        var data = {
                            phone:this.phone,
                            verify_code:this.verify_code,
                            type:1
                        };

                        var callback = function () {
                            api.openFrame({
                                name: "set_password",
                                url: "set_password.html",
                                bounces:false,
                                pageParam: data,
                            });
                        };
                        pinet.post(URL.verifyCode, data, callback);
                    }
                },
            }
        })
    }
</script>
</body>
</html>
